set(STATS_CLIENT stats_client)
set(STATS_CLIENT_SRCS stats_client.cpp ${CMAKE_SOURCE_DIR}/common/logging/logging.cpp )
set(STATS_CLIENT_SRCS ${STATS_CLIENT_SRCS} ${CMAKE_SOURCE_DIR}/components/network/setup_mcast.cpp)


PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
set(STATS_CLIENT_SRCS ${STATS_CLIENT_SRCS} ${PROTO_SRCS})
set(STATS_CLIENT_SRCS ${STATS_CLIENT_SRCS} Stats_ClientOptions.cpp)
set(STATS_CLIENT_SRCS ${STATS_CLIENT_SRCS}
        components/network/send_enc_pb_message.cpp
        components/network/recv_service_reply.cpp
        components/protocol/create_enc_service_request.cpp
        components/protocol/decode_enc_pb_reply.cpp
        components/protocol/client_service_request.cpp
        components/protocol/recv_service_replies.cpp
        components/protocol/stats_client_processor.cpp
        components/service/mcast_client_process.cpp
        components/application/stats_mcast_client.cpp

)
set(STATS_CLIENT_SRCS ${STATS_CLIENT_SRCS}
        ${CMAKE_SOURCE_DIR}/patterns/handlers.cpp
        ${CMAKE_SOURCE_DIR}/components/utils/linear_flight_timer.cpp
        ${CMAKE_SOURCE_DIR}/components/encrypt/utils.cpp
        ${CMAKE_SOURCE_DIR}/components/encrypt/aes_service.cpp
        ${CMAKE_SOURCE_DIR}/components/encrypt/blowfish_service.cpp
)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/stats_client)
add_executable(${STATS_CLIENT} ${STATS_CLIENT_SRCS})
SET_TARGET_PROPERTIES(${STATS_CLIENT} PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(${STATS_CLIENT}  ${CONFIG_LIB_NAME} ${CRYPTOPP_LIBRARIES} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${PTHREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}
  ${GLOG_LIBRARIES} ${PROTOBUF_LIBRARY})


INSTALL(TARGETS ${STATS_CLIENT} DESTINATION local/bin)
